﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using ThreeByte.ActiveDeck.Config;
using System.Windows.Forms.Integration;
using System.Net;

namespace ThreeByte.ActiveDeck.AddIn.Controls
{
    public partial class NamePresentationForm : Form
    {
        public NamePresentationForm(CoreConfig config, NetworkCredential creds = null, bool rename = false) {
            InitializeComponent();

            NamePresentationControl presentationControl = new NamePresentationControl(config, creds, rename);
            presentationControl.Close += new EventHandler<DialogResultEventArgs>(presentationControl_Close);
            
            //Add Setup Form
            ElementHost elementHost = new ElementHost();
            elementHost.Dock = DockStyle.Fill;
            elementHost.Location = new Point(0, 0);
            elementHost.Name = "elementHost";
            elementHost.Child = presentationControl;
            elementHost.AutoSize = true;
            this.Controls.Add(elementHost);

            
        }

        void presentationControl_Close(object sender, DialogResultEventArgs e) {
            this.DialogResult = e.DialogResult;
        }

        private void NamePresentationForm_FormClosing(object sender, FormClosingEventArgs e) {
            
        }
    }
}
